package com.undsf.study7816.fatego.po;

/**
 * Created by Arathi on 2017/8/16.
 */
public enum ServantClass {
    Saber(1, "剑士", "セイバー"),
    Archer(2, "弓兵", "アーチャー"),
    Lancer(3, "枪兵", "ランサー"),
    Rider(4, "骑兵", "ライダー"),
    Caster(5, "魔术师", "キャスター"),
    Assassin(6, "暗匿者", "アサシン"),
    Berserker(7, "狂战士", "バーサーカー"),
    Shielder(8, "盾兵", "シールダー"),
    Ruler(9, "裁定者", "ルーラー"),
    Avenger(10, "复仇者", "アヴェンジャー"),
    GrandCaster(105, "冠位魔术师", "グランドキャスター"),
    All(100, "全部", "全部");

    private int index;
    private String jpName;
    private String cnName;

    ServantClass(int index, String cnName, String jpName) {
        this.index = index;
        this.cnName = cnName;
        this.jpName = jpName;
    }

    public int getIndex() {
        return this.index;
    }

    public String getName() {
        if (index == GrandCaster.getIndex()) {
            return "Grand Caster";
        }
        return name();
    }

    public String getCnName() {
        return this.cnName;
    }

    public String getJpName() {
        return this.jpName;
    }

    // @Override
    // public int compareTo(E c) {
    //     return c.index - index;
    // }

    // public static ServantClass ConvertFromIndex(int index) {
    //     for (ServantClass e : values()) {
    //         if (e.index != index) continue;
    //         return e;
    //     }
    //     return null;
    // }
}
